package net.libra.ui
{
	import net.libra.ui.base.BaseSprite;
	
	public class Border extends BaseSprite
	{
		public function Border(width:uint,height:uint,color:uint,px:uint)
		{
			super();
			var s16:String = "00000000"+color.toString(16);
			s16 = s16.substr(-8);
			var color:uint = parseInt(s16.substr(2),16);
			var alpha:Number = (parseInt(s16.substr(0,2),16)/255);
			graphics.beginFill(color,alpha);
			graphics.drawRect(0,0,width,height);
			graphics.drawRect(px,px,width-px*2,height-px*2);
			graphics.endFill();
		}
		override public function destroy():void
		{
			graphics.clear();
			super.destroy();
		}
	}
}